/* tenant */
import { 
  registerExternalFunctions as registerTenantExternalFunctions, 
  registerExternalUtils as registerTenantExternalUtils
} from '@shb-lib/tenant'
/* version */
import { 
  registerExternalFunctions as registerVersionExternalFunctions,
  registerExternalUtils as registerVersionExternalUtils
} from '@shb-lib/version'
/* util */
import http from '@src/util/http'
/* local */
import { t } from '@src/locales'

function init () {
  
  try {
    
    // 外部方法
    const registerExternalFunctionsList = [
      registerTenantExternalFunctions,
      registerVersionExternalFunctions
    ]
    
    registerExternalFunctionsList.forEach(registerExternalFunctions => {
      registerExternalFunctions({
        t
      })
    })
    
    // 外部工具
    const registerExternalUtilsList = [
      registerTenantExternalUtils,
      registerVersionExternalUtils
    ]
    registerExternalUtilsList.forEach(registerExternalUtils => {
      registerExternalUtils({
        http
      })
    })
    
  } catch (error) {
    
    console.error(error)
    
  }
  
}

init()
